import { createRequest } from '/@/api/service';
const module = 'ib/flowpath/v1/FlowpathTemplateApi/';
/**
 * 查询审批列表
 */
function QUERY_FLOW_PATH_TEMPLATE_LIST(
  data: FlowpathTemplateApi.QueryFlowpathTemplateListReq,
  header: object = {},
): Promise<FlowpathTemplateApi.QueryFlowpathTemplateListResp> {
  return createRequest(
    `${process.env.APP_API_URL}${module}queryFlowpathTemplateList`,
    data,
    header,
    'POST',
  );
}

/**
 * 查看审批详情
 */
function QUERY_FLOW_PATH_TEMPLATE_DETAIL(
  data: FlowpathTemplateApi.QueryFlowpathTemplateDetailReq,
  header: object = {},
): Promise<FlowpathTemplateApi.QueryFlowpathTemplateDetailResp> {
  return createRequest(
    `${process.env.APP_API_URL}${module}queryFlowpathTemplateDetail`,
    data,
    header,
    'POST',
  );
}

/**
 * 查看审批模板详情-为新增流程
 */
function QUERY_FTD_FOR_ADD_FLOW(
  data: FlowpathTemplateApi.QueryFlowpathTemplateDetailReq,
  header: object = {},
): Promise<FlowpathTemplateApi.QueryFlowpathTemplateDetailResp> {
  return createRequest(
    `${process.env.APP_API_URL}${module}queryFtdForAddFlow`,
    data,
    header,
    'POST',
  );
}

/**
 * 根据属性条件查看流程
 */
function QUERY_FLOW_BY_COND_ATTR(
  data: FlowpathTemplateApi.QueryFlowByCondAttrReq,
  header: object = {},
): Promise<FlowpathTemplateApi.QueryFlowByCondAttrResp> {
  return createRequest(
    `${process.env.APP_API_URL}${module}queryFlowByCondAttr`,
    data,
    header,
    'POST',
  );
}

export {
  QUERY_FLOW_PATH_TEMPLATE_LIST,
  QUERY_FLOW_PATH_TEMPLATE_DETAIL,
  QUERY_FTD_FOR_ADD_FLOW,
  QUERY_FLOW_BY_COND_ATTR,
};
